function fib(n) {
    if (n <= 2) {
        return 1;
    }
    return fib(n - 1) + fib(n - 2);
}



self.onmessage = function(event){
    var n = event.data;
    var result = fib(n);
    self.postMessage(result);
}


